package com.flying.invest.survey.model;

import com.flying.common.util.Codes;
import com.flying.framework.annotation.ConstantEnum;
import com.flying.framework.annotation.Param;
import com.flying.framework.data.Data;
import com.flying.framework.data.DataSerializable;
import com.flying.framework.metadata.Meta;

@SuppressWarnings("serial")
@Meta(id="i_survey",title="调查问卷", table="i_survey", primaryKeys={"survey_id"})
public class Survey extends Data implements DataSerializable {
	public final static String ENTITY_NAME = "i_survey";
	
	public final static String SURVEY_ID = "survey_id";
	public final static String NAME = "name";
	public final static String REMARKS = "remarks";
	public final static String STATUS = "status";
	
	
	@Param(value=SURVEY_ID,   required=true,   maxlength=0,	desc="调查ID" , generator=Codes.AUTO_INCREMENT)
	private Long surveyId;
	
	@Param(value=NAME,   required=false,   maxlength=50,	desc="名称" )
	private String name;
	
	@Param(value=REMARKS,   required=false,   maxlength=400,	desc="说明" )
	private String remarks;
	
	@Param(value=STATUS,   required=false,   maxlength=0,	desc="状态（1：有效；0：无效）" )
	private Integer status;
	
	public enum Status implements ConstantEnum<Integer> {
		INVALID(0, "无效"), VALID(1, "有效");

		public final int value;
		public final String remarks;

		Status(int value, String remarks) {
			this.value = value;
			this.remarks = remarks;
		}
		
		@Override
		public Integer value() {
			return this.value;
		}

		@Override
		public String text() {
			return remarks;
		}
	}
	
	public Long getSurveyId() {
		return this.surveyId;
	}
	
	public void setSurveyId(Long surveyId) {
		this.surveyId = surveyId;
	}
	
	public String getName() {
		return this.name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getRemarks() {
		return this.remarks;
	}
	
	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}
	
	public Integer getStatus() {
		return this.status;
	}
	
	public void setStatus(Integer status) {
		this.status = status;
	}
	

}